docs: fix search ranking, add relevance smoke test and heading discoverability - #847
docs: fix search ranking, add relevance smoke test and heading discoverability#847kaviththiranga wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (8)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe PR adds a live Algolia search smoke test with scheduled and manual GitHub Actions execution. It documents the search configuration and adds explicit anchors to platform engineering documentation headings. ChangesSearch smoke testing
Documentation anchors
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🟡 Moderate · up to This adds a daily search-validation workflow and documentation anchors. The workflow should explicitly restrict its token to read-only access before merge to avoid granting unnecessary repository-write capability. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant SearchSmoke
participant Algolia
GitHubActions->>SearchSmoke: Run npm run test:search
SearchSmoke->>Algolia: Submit golden query with facet filters
Algolia-->>SearchSmoke: Return paginated hits
SearchSmoke-->>GitHubActions: Report results and exit status
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (7 skipped: 7 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
20abc85 to
fe2ff6d
Compare
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Problem
Searching the docs returned everything except the page you wanted. "Authorization" ranked the authorization overview at #57, and the top 20 results were just 5 pages — 4 of them AuthzRole CRD references.
Two causes in the Algolia index config:
searchableAttributessearchedhierarchy.lvl0(the sidebar category label) ahead oflvl1(the page's H1). The API-reference category is labelled exactlyAuthorization, so its CRD pages beat the guide titled "Authorization in OpenChoreo".attributeForDistinctwasurl, which includes the anchor — so one page contributed a record per heading and could fill every slot.Fixed in the Algolia dashboard (not in this PR)
hierarchy.lvl0moved afterlvl6;attributeForDistinct→url_without_anchorwithdistinct: 2; both mirrored into the crawler'sinitialIndexSettingsso a reindex can't revert them;/docs/category/*stubs no longer indexed.authorizationrbacobservabilitycustom roles/cel conditionsIn this PR
scripts/search-smoke.mjs— replays the site's real search query and asserts the expected page ranks and that results span ≥8 distinct pages. No dependencies. Daily workflow +npm run test:search.scripts/ALGOLIA.md,algolia-index-settings.json— the Algolia config only lived in a dashboard with no change history. Now reviewable and restorable.Anchors are pinned to their original IDs, so existing links keep working. Applied to both
docs/andversioned_docs/version-v1.2.x/— the live/docs/*pages come from the versioned copy.